// Package handler
// Title  		user.handler.go
// Description  ClusterHandler协调适配器
// Author  alittlexincan@163.com  2024/07/22 11:36
// Update  alittlexincan@163.com  2024/07/22 11:36
package handler

import (
	"github.com/go-kit/kit/transport/http"
	"xincan.com.cn/tarot-go-framework/business/user/endpoint"
	"xincan.com.cn/tarot-go-framework/business/user/service"
	"xincan.com.cn/tarot-go-framework/business/user/transport"
	"xincan.com.cn/tarot-go-framework/utils"
)

// CreateUserHandler
// Title    		CreateUserHandler
// Description   	创建用户
// Auth      		alittlexincan@163.com         	"时间（2024/07/22 11:36）"
// Return    		*http.Server    				"创建用户"
func CreateUserHandler() *http.Server {
	svc := service.NewUserService()
	ep := endpoint.MakeCreateUserEndpoint(svc)
	return http.NewServer(ep, transport.DecodeCreateUserRequest, utils.EncodeResponse)
}

// SearchUserListHandler
// Title    		SearchUserListHandler
// Description   	查询集群节点信息统计
// Auth      		alittlexincan@163.com         	"时间（2024/07/22 11:36）"
// Return    		*http.Server    				"查询集群节点信息"
func SearchUserListHandler() *http.Server {
	svc := service.NewUserService()
	ep := endpoint.MakeSearchUserListEndpoint(svc)
	return http.NewServer(ep, transport.DecodeSearchUserListRequest, utils.EncodeResponse)
}
